package leetcode.code0274;

import java.util.Arrays;

public class Solution extends Solution274 {

	@Override
	public int hIndex(int[] citations) {
		Arrays.sort(citations);
		int n = citations.length;
		for (int i = 0; i <n; i++) {
			if (citations[i] >= n - i) {
				return n - i;
			}
		}
		return 0;
	}

	public static void main(String[] args) {
		Solution so = new Solution();
		so.debug1();
		so.debug2();
		so.debug3();
		so.debug4();
		so.debug5();
		so.debug6();

	}

}
